package org.csie.jimms.java.example;

import org.json.JSONException;
import org.json.JSONObject;

public class MyObject extends MyJSONObject {
	String name;
	String address;
	int age;

	public MyObject(JSONObject json) throws JSONException {
		name = json.getString("name");
		address = json.getString("address");
		age = json.getInt("age");
	}
	
	public MyObject(String jsonString) throws JSONException {
		this(new JSONObject(jsonString));
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @return the address
	 */
	public String getAddress() {
		return address;
	}

	/**
	 * @return the age
	 */
	public int getAge() {
		return age;
	}
}
